package demo1;

public class Test {

    public static void sleep(Animal animal) {
        animal.eat();
    }

    public static void main(String[] args) {
        //(new Dog("大黄", 2));

        Animal animal1 = new Dog("大黄", 2);
        Animal animal2 = new Dog("大白", 1);

        animal1.eat();
        animal2.eat();

        Animal animal3 = new Cat("旺财", 2);
        Animal animal4 = new Cat("小橘", 2);

        animal3.eat();
        animal4.eat();

    }

}
